package org.farng.mp3.id3;

import org.farng.mp3.InvalidTagException;
import org.farng.mp3.object.ObjectNumberHashMap;
import org.farng.mp3.object.ObjectStringDate;
import org.farng.mp3.object.ObjectStringNullTerminated;
import org.farng.mp3.object.ObjectStringSizeTerminated;

import java.io.IOException;


/**
 * Title: Description: Copyright:    Copyright (c) 2002 Company:
 *
 * @author Eric Farng
 * @version $Revision: 1.3 $
 */
public class FrameBodyOWNE extends AbstractID3v2FrameBody {
    /**
     * Creates a new FrameBodyOWNE object.
     */
    public FrameBodyOWNE() {
        //        this.setObject("Text Encoding", new Byte((byte) 0));
        //        this.setObject("Price Paid", "");
        //        this.setObject("Date Of Purchase", "");
        //        this.setObject("Seller", "");
    }

    public FrameBodyOWNE(FrameBodyOWNE body) {
        super(body);
    }

    /**
     * Creates a new FrameBodyOWNE object.
     *
     * @param textEncoding DOCUMENT ME!
     * @param pricePaid DOCUMENT ME!
     * @param dateOfPurchase DOCUMENT ME!
     * @param seller DOCUMENT ME!
     */
    public FrameBodyOWNE(byte textEncoding, String pricePaid, String dateOfPurchase, String seller) {
        this.setObject("Text Encoding", new Byte(textEncoding));
        this.setObject("Price Paid", pricePaid);
        this.setObject("Date Of Purchase", dateOfPurchase);
        this.setObject("Seller", seller);
    }

    /**
     * Creates a new FrameBodyOWNE object.
     *
     * @param file DOCUMENT ME!
     *
     * @throws IOException DOCUMENT ME!
     * @throws InvalidTagException DOCUMENT ME!
     */
    public FrameBodyOWNE(java.io.RandomAccessFile file)
                  throws IOException, InvalidTagException {
        this.read(file);
    }

    /**
     * DOCUMENT ME!
     *
     * @return DOCUMENT ME!
     */
    public String getIdentifier() {
        return "OWNE";
    }

    /**
     * DOCUMENT ME!
     */
    protected void setupObjectList() {
        objectList.add(new ObjectNumberHashMap(ObjectNumberHashMap.TEXT_ENCODING, 1));
        objectList.add(new ObjectStringNullTerminated("Price Paid"));
        objectList.add(new ObjectStringDate("Date Of Purchase"));
        objectList.add(new ObjectStringSizeTerminated("Seller"));
    }
}